package graphSample;

import java.util.HashMap;

import core.Entity;
import core.Graph;
import core.Process;

public class SimpleGraph {
	
	static public void main(String[] argv){
		SimpleGraph.getGraph().printResultToFile();
	}
	
	static public Graph getGraph(){
		Graph g = new Graph("Test");
		
		// Entities
		Entity e1 = new Entity(g, "State1");
		e1.addVariable("$x","INT");
		
		Entity e2 = new Entity(g, "State2");
		e2.addVariable("$y","INT");
		
		// Processes
		Process p1 = new Process(g, "Process1", "TRUE");
		p1.addEntityIn(e1);
		p1.addEntityOut(e2);
		for(int i = 0; i<40; i++){
			p1.addEvalItem("$y=$x+1");
		}
		
		//Add token in e1
		HashMap<String,String> token;
		for(int i=0;i<20000;i++){
			token = new HashMap<String,String>();
			token.put("$x", String.valueOf(i));
			e1.addToken(token);
		}
		
		return g;
	}
}
